Dynomotion

Group: DynoMotion Message: 9658 From: Sam Marrocco Date: 6/16/2014
Subject: Best method of "waiting for gcode to complete"...
I'd like to set a global variable in my code that all running threads (DRO readers, Jog tools, etc) can check to determine if the KM_Interpreter is running gcode. The safest method I can find to do this would be setup something like this:

Set IsRunningGCode=True in the Interpreter.StatusUpdated event the first time it is raised, then

Set IsRunningGCode=False when the Interpreter.StatusCompleted event is raised

....but this could miss any code that runs before the first time the StatusUpdated event is raised. Is there already a variable like this available or is there a method of checking that GCode is running (or not) already since Interpreter.Interpret() returns immediately after being called? Or does the StatusUpdated event return something akin to "I'm beginning to run GCode".

My end goal here is to disable my UI and any chance of the user running other GCode/motion during the time that the already running GCode is being processed while also checking for Aborts.


--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9659 From: Tom Kerekes Date: 6/16/2014
Subject: Re: Best method of "waiting for gcode to complete"...
Hi Sam,

I would set your IsRunningGCode=True before launching the GCode Interpreter.

Regards
TK

Group: DynoMotion Message: 9660 From: Sam Marrocco Date: 6/17/2014
Subject: Re: Best method of "waiting for gcode to complete"...

On 6/17/2014 12:55 AM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi Sam,

I would set your IsRunningGCode=True before launching the GCode Interpreter.


Is the InterpreterCompleted event raised after a call to Interpreter.Interpret() even if the interpreter encounters an error or crashes?

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 9661 From: Tom Kerekes Date: 6/17/2014
Subject: Re: Best method of "waiting for gcode to complete"...
Hi Sam,

If the Interpreter encounters an error the callback will have a non-zero status there will be an error string message.

The Interpreter should never "crash".  If it does all bets are off :}

Regards
TK